# !/usr/bin/env python
# -*-coding:utf-8 -*-

"""
# File       : option_schema.py
# Time       ：2023/11/3 16:47
# Author     ：YangYong
# version    ：python 3.10
# Description：流程版本选项
"""
from marshmallow import fields
from marshmallow_sqlalchemy import SQLAlchemyAutoSchema


class OptionSchema(SQLAlchemyAutoSchema):
    label = fields.String()
    value = fields.String()


class NameSpaceOptionSchema(SQLAlchemyAutoSchema):
    label = fields.Function(lambda obj: obj.process_name)
    value = fields.Function(lambda obj: obj.process_id)
